<?php
$pageTitle = '友情链接';
include 'header.tpl.php'; ?>

<table>
  <tr>
    <td>
	<form action="" method="get">
	<label for="typeid">分类</label>
	<select name="typeid">
		<option value="">全部</option>
		<?php foreach ($linkTypes as $type):?>
		<option value="<?php echo $type['id'];?>" <?php if ($type['id']==$typeid):?>selected="selected"<?php endif;?>><?php echo $type['name'];?></option>
		<?php endforeach;?>
	</select>
	<label for="pageSize">每页</label>
		<input name="pageSize" value="<?php echo $pageSize ? $pageSize : 40;?>" style="width:20px" />
	<input type="submit" value="查看">
	</form>
	</td>
  </tr>
</table>

<table>
  <tr>
    <th>ID</th>
    <th>名称</th>
    <th>logo</th>
    <th>图片</th>
    <th>删除</th>
  </tr>
  <?php foreach ($links as $link):?>
  <tr>
    <td><?php echo $link['id'];?></td>
    <td><a href="<?php echo $link['url'];?>" target="_blank"><?php echo $link['name'];?></a></td>
    <td><?php if ($link['logo']):?><a href="<?php echo APP_HOST . $link['logo'];?>" target="_blank"><img src="<?php echo APP_HOST . $link['logo'];?>" width="88" height="33" /></a><?php endif;?></td>
    <td><?php echo $link['url'];?></td>
    <td><a href="<?php echo $short_router?>del?id=<?php echo $link['id'];?>">删除</a>
    ,<a href="<?php echo $short_router?>edit?id=<?php echo $link['id'];?>">修改</a>
    </td>
  </tr>
  <?php endforeach;?>
</table>

<div class="pageNav">
<?php echo $pageNav;?>
</div>



<?php include 'footer.tpl.php';?>